#!/bin/sh

if [ -z $1 ]; then
	echo "uso: do.sh carpeta_de_tests"
	return;
fi

WD=$PWD
cd $1

echo "calculando maximo y minimo valor"
for file in $(ls -t *.pm); do
	echo $file
	$WD/translate_matrix -t -i $file -o $file.cm;
done
$WD/min_max.py $(ls -t *.cm)
#rm *.cm

echo "traduciendo matrices"
for file in $(ls -t *.pm); do
	echo $file
	$WD/translate_matrix -i $file -o $file.png;
done
